Skip to content

Add missing timeout in HTTP_Client request, in sr1() call#4751

Merged
gpotter2 merged 1 commit into
secdev:masterfrom
tryger:http-client
May 28, 2025
Merged

Add missing timeout in HTTP_Client request, in sr1() call#4751
gpotter2 merged 1 commit into
secdev:masterfrom
tryger:http-client

Conversation

@tryger
Copy link
Copy Markdown
Contributor

@tryger tryger commented May 28, 2025

When performing HTTP request with HTTP_Client, request() mehod stucks in sr1() when the request is to a non HTTP port, e.g. HTTPS port. This happens even when timeout parameter is passed to request() method.

To fix this, I added timeout parameter passing to sr1() call to TCP socket. This prevents request() from stucking when timeout is passed as argument.

@codecov
Copy link
Copy Markdown

codecov Bot commented May 28, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 82.15%. Comparing base (38ab7de) to head (8a68083).
Report is 1 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #4751   +/-   ##
=======================================
  Coverage   82.15%   82.15%           
=======================================
  Files         361      361           
  Lines       87279    87279           
=======================================
+ Hits        71701    71705    +4     
+ Misses      15578    15574    -4     
Files with missing lines Coverage Δ
scapy/layers/http.py 83.73% <100.00%> (ø)

... and 6 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Copy Markdown
Member

@gpotter2 gpotter2 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR !

@gpotter2 gpotter2 merged commit 611c929 into secdev:master May 28, 2025
24 checks passed
@gpotter2 gpotter2 added this to the 2.7.0 milestone Nov 2, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants